﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TowerDefense
{
    public static class CreepFactory
    {
        public static Creep CreateCreep(CreepTypes type, int levelModifer)
        {
            Creep c = new Creep(World.CurrentMap.Route.Waypoints,false);

            switch (type)
            {
                case CreepTypes.GroundCreep:
                    c.Armor = 1 * (levelModifer / 2);
                    c.Health = 100 * (levelModifer / 2);
                    c.CurrentState = Creep.CreepState.Moving;
                    c.IsAir = false;
                    c.Name = "Level " + levelModifer.ToString() + " ground Creep";
                    c.Speed = 10;
                    c.Texture = TDGame.textures["pacman"];
                    c.TopView = false;
                    break;
            }

            return c;
        }

        public static List<Creep> CreateLots(CreepTypes type, int levelModifier, int amount)
        {
            List<Creep> creeps = new List<Creep>(amount);

            Creep c = CreateCreep(type, levelModifier);

            for (int i = 0; i <= amount; i++)
            {
                creeps.Add((Creep)c.Clone());
            }

            return creeps;
        }

    }
}
